#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <string.h>
void Rollback(char* p, int len)
{
    if (*p != NULL)
    {
        char tmp = '0';
        int i = 0;
        for (i = 0; i < len / 2; i++)
        {
            tmp = *(p + i);
            *(p + i) = *(p + len-1-i);
            *(p + len-i-1) = tmp;
        }
    }
}

int main()
{
    char ch[80] = { '0' };
    printf("请输入一个字符串：");
    gets(ch);
    int len = strlen(ch);
    Rollback(ch, len);
    printf("逆置后的字符串为：");
    puts(ch);
    return 0;
}